package com.mvc.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.mvc.dao.IRateDao;
import com.mvc.po.Rates;

@Repository
public class RateDAOImpl implements IRateDao {
	
	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<Rates> getRete(String currency) {
		return this.jdbcTemplate.queryForList("select * from exchangerateeterm where currency = " + currency, Rates.class);
	}

	@Override
	public Rates getRate(String currency) {
		return this.jdbcTemplate.queryForObject("select * from exchangerateeterm where currency = " + currency, Rates.class);
	}
	

}
